//
//  XDDetailsCollectionViewCell.m
//  Le way walkers
//
//  Created by YaZhiLiang on 15/5/14.
//  Copyright (c) 2015年 LTXZ. All rights reserved.
//

#import "XDDetailsCollectionViewCell.h"

@interface XDDetailsCollectionViewCell ()

@end

@implementation XDDetailsCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.MyImage = [[UIImageView alloc]init];
        
        [self.contentView addSubview:self.MyImage];
        
        self.name = [[UILabel alloc] init];
        
        [self.MyImage addSubview:self.name];
        
        [_name release];
        
        [_MyImage release];
        
    }
    return self;
}


-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.MyImage.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.bounds.size.height);
    
    self.MyImage.layer.cornerRadius = 8;
    
    self.MyImage.layer.masksToBounds = YES;
    
    self.MyImage.userInteractionEnabled = YES;
    
    self.name.frame = CGRectMake(10, 100, 120, 40);
    
    self.name.font = [UIFont systemFontOfSize:17.0];
    
//    self.name.backgroundColor = [UIColor blackColor];
    
    self.name.textColor = [UIColor whiteColor];
    
    self.name.userInteractionEnabled = YES;
    
}


    
//    [self.MyImage sd_setImageWithURL:(NSURL *)xdModel.cover_s placeholderImage:[UIImage imageNamed:@"1.jpg"]];
- (void)setXdDeails:(XDDetailsCollectionViewModel *)xdDeails
{
    
    if (_xdDeails != xdDeails) {
        
        [_xdDeails release];
        
        _xdDeails = [xdDeails retain];
    }
    

    [self.MyImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", xdDeails.cover_s]]];
    
    NSLog(@"wangzhi%@", xdDeails.cover_s);
    
    self.name.text = xdDeails.name;
    
    NSLog(@"wenzi %@", xdDeails.name);
    
    self.typeName = xdDeails.type;
    
    self.ScenicID = xdDeails.ScenicID;
    
}

@end
